From: Stefan Kangas Date: Sun, 26 Sep 2021 18:20:20 +0000 (+0200) Subject: checkdoc: Don't add "Commentary" header to test files X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~18^2~841 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=77494628e2bf6edb8cdb3f78784aab880a6b87a2;p=emacs.git checkdoc: Don't add "Commentary" header to test files * lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Don't add "Commentary:" header if it looks like a test file. --- diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 24e1ae3f097..b3707bb7863 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -2385,8 +2385,13 @@ Code:, and others referenced in the style guide." err (or ;; * Commentary Section - (if (not (lm-commentary-mark)) - (progn + (if (and (not (lm-commentary-mark)) + ;; No need for a commentary section in test files. + (not (string-match + (rx (or (seq (or "-test.el" "-tests.el") string-end) + "/test/" "/tests/")) + (buffer-file-name)))) + (progn (goto-char (point-min)) (cond ((re-search-forward